<div class="problemindexholder" problemindex="B">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     B. Lazy Security Guard
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     2 seconds
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     Your security guard friend recently got a new job at a new security company. The company requires him to patrol an area of the city encompassing exactly
     <span class="tex-span">
      <i>
       N
      </i>
     </span>
     city blocks, but they let him choose which blocks. That is, your friend must walk the perimeter of a region whose area is exactly
     <span class="tex-span">
      <i>
       N
      </i>
     </span>
     blocks. Your friend is quite lazy and would like your help to find the shortest possible route that meets the requirements. The city is laid out in a square grid pattern, and is large enough that for the sake of the problem it can be considered infinite.
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     Input will consist of a single integer
     <span class="tex-span">
      <i>
       N
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       N
      </i>
      ≤ 10
      <sup class="upper-index">
       6
      </sup>
     </span>
     ), the number of city blocks that must be enclosed by the route.
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     Print the minimum perimeter that can be achieved.
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>4<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>8<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>11<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>14<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>22<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>20<br/></pre>
     </div>
    </div>
   </div>
   <div class="note">
    <div class="section-title">
     Note
    </div>
    <p>
     Here are some possible shapes for the examples:
    </p>
    <p>
     <img class="tex-graphics" src="/predownloaded/fb/71/fb71ad39e5f414229f68641c2c6d294d6c400e9e.png" style="max-width: 100.0%;max-height: 100.0%;"/>
    </p>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
